package com.tansty.web.controller;

import com.tansty.common.utils.CommonUtil;
import com.tansty.common.utils.RedisUtil;
import com.tansty.pojo.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * description:  <br>
 * date: 2021/9/12 12:47 <br>
 * author: ztz <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/hot")
public class HotController {
    @Autowired
    RedisUtil redisUtil;
    @GetMapping("/data/{name}")
    public ResultVO getHotWeiBo(@PathVariable String name){
        return CommonUtil.ajaxReturn( redisUtil.lGet(name + "_hot", 0, 9));
    }
}
